<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head th:insert="fragments/head">
</head>
<body>
<header th:insert="fragments/header"></header>

<main>
    <div class="container">
        <h3 class="center">Editar Datos</h3>
        <br>
        <div class="row">
            <div class="section col s12 l6 offset-l3">
                <form action="#" method="post"
                      th:object="${user}"
                      th:action="@{/user/edit/{id_user} (id_user=${user.id})}"
                >

                    <div class="input-field">
                        <label for="nom_usuario">Nombre</label>
                        <input type="text" class="class-controller"
                               id="nom_usuario"
                               th:field="*{nombre}" autofocus required
                        >
                    </div>

                    <div class="input-field">
                        <label for="ape_usuario">Apellido</label>
                        <input type="text" class="class-controller"
                               id="ape_usuario"
                               th:field="*{apellido}" required
                        >
                    </div>

                    <div class="input-field">
                        <label for="correo_usuario">Correo Electrónico</label>
                        <input type="text" class="class-controller"
                               id="correo_usuario"
                               th:field="*{email}" required
                        >
                    </div>

                    <div class="input-field">
                        <label for="imgurl">URL Imagen de Perfil</label>
                        <input type="text" class="class-controller" id="imgurl" th:field="*{imgurl}" required>
                    </div>

                    <button type="submit" class="btn">
                        Editar
                    </button>
                    <a th:href="@{/profile}" class="btn red lighten-1">Atras</a>
                </form>
            </div>
        </div>
    </div>
</main>
<br><br>

<footer class="page-footer teal" th:insert="fragments/footer">
</footer>

<!--  Scripts-->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="/js/materialize.js"></script>
<script src="/js/init.js"></script>
</body>
</html>